import 'package:flutter/material.dart';

class EmptyComp extends StatefulWidget {
  EmptyComp({super.key, this.desc});
  String? desc = "空状态";
  @override
  State<EmptyComp> createState() => _EmptyCompState();
}

class _EmptyCompState extends State<EmptyComp> {
  String? desc = '';

  @override
  void initState() {
    super.initState();
    setState(() {
      desc = widget.desc;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        spacing: 20,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Image.asset(
            'assets/ic_not_found.png',
            width: 200,
            height: 120,
          ),
          Text(
            '$desc',
            style: TextStyle(fontSize: 16, color: Colors.grey),
          )
        ],
      ),
    );
  }
}
